// TypeScript file

class win_result extends egret.Sprite {

    public constructor() {
        super();
        this.once(egret.Event.ADDED_TO_STAGE, this.createView, this);
    }

    //中奖结果页 
   private createView(){
       this.addChild(createBitmap("bgsec_png"));                                 //添加容器背景  

       var win_result = div(0,0,750,0,750,1206,0,1206,0,1206,0,0);           //添加容器
       this.addChild(win_result);


        //雪花背景
        var snowBG1 = createBitmap("one_snowflower_png", 0, 0);
        var snowBG2 = createBitmap("one_snowflower_png", 0, -1206);
        win_result.addChild(snowBG1);
        win_result.addChild(snowBG2);
        egret.Tween.get(snowBG1, { loop: true }).to({ y: 1206 }, 10000);
        egret.Tween.get(snowBG2, { loop: true }).to({ y: 0 }, 10000);

       var winningImg = createBitmap("winresultPink_png",30,20);             //添加标题粉红背景图
       win_result.addChild(winningImg)

       var win_title  = createTextFiled("中  奖  了 ！",117,25,48,0xffffff,"center",560,88,"middle");                                                                  //添加标题
       win_title.bold = true;
       win_result.addChild(win_title);

       var win_bgmsg = createBitmap("winresultBg_png",20,147);
       win_result.addChild(win_bgmsg);
       
       var jpmc = createTextFiled("( 奖品名称 )",270,860,35,0xffffff,"center",200,50,"middle");
       jpmc.bold = true;
       win_result.addChild(jpmc);

       var win_receive = createTextFiled("已被你翻牌，请火速前来领取",0,910,28,0xffffff,"center",750,50,"middle");
       win_receive.bold = true;
       win_result.addChild(win_receive);

       var place = createTextFiled("领取地址：",120,1020,28,0xffffff,"left");
       win_result.addChild(place);

       var ad = createTextFiled("广州海珠区新港东路中洲交易中心8888号2999室",260,1020,28,0xffffff,"left",380);
       ad.lineSpacing = 10 ;
       win_result.addChild(ad);

       var receive_methed = createTextFiled("领取方式：",120,1100,28,0xffffff,"left");
       this.addChild(receive_methed);

       var time = createTextFiled("2016年06月15日-2017年04月30日到现场领取",260,1100,28,0xffffff,"left",380);
       time.lineSpacing = 10 ;
       win_result.addChild(time);

       //中奖奖品图片
       var prize = createBitmap("vipcard_png",250,470)
       prize.scaleX=2;
       prize.scaleY=2;
       win_result.addChild(prize);
        egret.Tween.get(prize,{loop:true}).to({ scaleX: 2, scaleY: 2 }, 1000).to({ scaleX: 2.5, scaleY: 2.5 }, 1000).to({ scaleX: 2, scaleY: 2 }, 1000);
   }
}
